let showData = require("./showData");

let ocr = $plugins.load("com.hraps.ocr");

let imgPathList = ["./res/某Q聊天内容截图.png", "./res/拍照_书的某页内容.jpg"];

let ocrType = "浩然";

var len = imgPathList.length;
for (var i = 0; i < len; i++) {
  let imgPath = imgPathList[i];
  log(imgPath);
  let img = images.read(imgPath);
  results = ocr.detect(img.getBitmap(), 1);
  showData(results, imgPath, ocrType);
  img.recycle();
}

// for (var i = 0; i < results.size(); i++) {
//   var re = results.get(i);
//   log("结果:" + i + "  文字:" + re.text + "  位置:" + re.frame + "  角度类型:" + re.angleType);
//   log("区域置信度:" + re.dbScore + "  角度置信度:" + re.angleScore + "  文字置信度:" + re.crnnScore + "\n");
// }
